//专门用来写固定右边的及js功能
define(['jquery'], () => {
    class Fix_the_right_side {
        constructor() {
            this.load()
        }
        load() {
            //专门记载固定右边文件
            $('.fix_the_right_side').load('/html/fix_the_right_side.html', (e) => {
                //获取页面卷曲出去的距离
                $(window).scroll(function () {
                    if ($(this).scrollTop() >= 300) {
                        $('.last-totop').css("opacity", "1")
                    } else {
                        $('.last-totop').css("opacity", "0")
                    }
                    $('.last-totop').click(function () {
                        //让页面回到顶部
                        $(window).scrollTop(0)
                        $(this).css("opacity", "0")
                    })
                })

            }
            )
        }

    }
    return new Fix_the_right_side()
})
